﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Bzure.Common.Core;
using Bzure.Common.Patterns;
using Bzure.Security;

namespace Bzure.Apps.Security.DataAccess
{
    [Export(typeof(IContractFactory<IAccountContract>))]
    public class AccountContractBuilder : IContractFactory<IAccountContract>
    {
        /// <summary>
        /// 契约实现的版本号
        /// </summary>
        public float ContractVersion { get { return 1.0F; } }
        public IAccountContract Build()
        {
            return new AccountProvider();
            //return DecorateFactory<IAccountContract>.CreateInstance(new AccountProvider());
        }
    }
    [Export(typeof(IContractFactory<IUserContract>))]
    public class UserContractBuilder : IContractFactory<IUserContract>
    {
        /// <summary>
        /// 契约实现的版本号
        /// </summary>
        public float ContractVersion { get { return 1.0F; } }
        public IUserContract Build()
        {
            return new AccountProvider();
            //return DecorateFactory<IAccountContract>.CreateInstance(new AccountProvider());
        }
    }
    [Export(typeof(IContractFactory<IUserGroupContract>))]
    public class UserGroupContractBuilder : IContractFactory<IUserGroupContract>
    {
        /// <summary>
        /// 契约实现的版本号
        /// </summary>
        public float ContractVersion { get { return 1.0F; } }
        public IUserGroupContract Build()
        {
            return new AccountProvider();
            //return DecorateFactory<IAccountContract>.CreateInstance(new AccountProvider());
        }
    }
}
